package com.ruoyi.bnt.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bnt.mapper.BntSpecialcolumnMapper;
import com.ruoyi.bnt.domain.BntSpecialcolumn;
import com.ruoyi.bnt.service.IBntSpecialcolumnService;
import com.ruoyi.common.core.text.Convert;

/**
 * 专栏Service业务层处理
 * 
 * @author yyj
 * @date 2020-09-29
 */
@Service
public class BntSpecialcolumnServiceImpl implements IBntSpecialcolumnService 
{
    @Autowired
    private BntSpecialcolumnMapper bntSpecialcolumnMapper;

    /**
     * 查询专栏
     * 
     * @param id 专栏ID
     * @return 专栏
     */
    @Override
    public BntSpecialcolumn selectBntSpecialcolumnById(String id)
    {
        return bntSpecialcolumnMapper.selectBntSpecialcolumnById(id);
    }

    /**
     * 查询专栏列表
     * 
     * @param bntSpecialcolumn 专栏
     * @return 专栏
     */
    @Override
    public List<BntSpecialcolumn> selectBntSpecialcolumnList(BntSpecialcolumn bntSpecialcolumn)
    {
        return bntSpecialcolumnMapper.selectBntSpecialcolumnList(bntSpecialcolumn);
    }

    /**
     * 新增专栏
     * 
     * @param bntSpecialcolumn 专栏
     * @return 结果
     */
    @Override
    public int insertBntSpecialcolumn(BntSpecialcolumn bntSpecialcolumn)
    {
        bntSpecialcolumn.setCreateTime(DateUtils.getNowDate());
        return bntSpecialcolumnMapper.insertBntSpecialcolumn(bntSpecialcolumn);
    }

    /**
     * 修改专栏
     * 
     * @param bntSpecialcolumn 专栏
     * @return 结果
     */
    @Override
    public int updateBntSpecialcolumn(BntSpecialcolumn bntSpecialcolumn)
    {
        bntSpecialcolumn.setUpdateTime(DateUtils.getNowDate());
        return bntSpecialcolumnMapper.updateBntSpecialcolumn(bntSpecialcolumn);
    }

    /**
     * 删除专栏对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBntSpecialcolumnByIds(String ids)
    {
        return bntSpecialcolumnMapper.deleteBntSpecialcolumnByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除专栏信息
     * 
     * @param id 专栏ID
     * @return 结果
     */
    @Override
    public int deleteBntSpecialcolumnById(String id)
    {
        return bntSpecialcolumnMapper.deleteBntSpecialcolumnById(id);
    }

    @Override
    public int addVisitNum(String id) {
        return bntSpecialcolumnMapper.addVisitNum(id);
    }
}
